#ifndef ASKDIALOG_H
#define ASKDIALOG_H

#include <QDialog>

namespace Ui {
class AskDialog;
}

class AskDialog : public QDialog
{
    Q_OBJECT

public:
    static AskDialog* GetInstance(QWidget *parent = nullptr);
    ~AskDialog();
    // 禁止拷贝和赋值
    AskDialog(const AskDialog&) = delete;
    AskDialog& operator=(const AskDialog&) = delete;

    // 调用并获取用户点击结果
    static bool GetUserClick(QWidget *parent = nullptr, const QString &title = "操作提示", const QString &message = "");

private slots:
    void on_ok_clicked();
    void on_cancel_clicked();

private:
    explicit AskDialog(QWidget *parent = nullptr);
    Ui::AskDialog *ui;
};

#endif // ASKDIALOG_H
